package example.mybatis.catalog.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.scaffold.catalog.entity.Catalog;

public interface CatalogMapper {
	 @Select("SELECT * FROM CATALOG WHERE id = #{id}")
	 Catalog getCatalog(long id);

	 @Select("SELECT * FROM CATALOG")
	 List<Catalog> selectCatalog();
	 
	 @Insert("insert into Catalog(id, name, parentId) values (SEQ_CATALOG.nextVal, #{name}, #{parentId})")
//	 @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
	 void insert(Catalog catalog);
}
